/-boot
/-docs
/-editor
/-files
/-files-old
/-imports
/-layout
/-shell
/-storage
/-storage/attached
/-storage/attached/api
/-storage/attached/dom
/-storage/attached/indexedDB
DetectStorage.ts
FileData.ts
LoadStorage.ts
MetadataData.ts
StorageAccess.ts
StorageDetect.ts
UpdateStorage.ts
functions.ts
/-storage/attached/localStorage
/-storage/attached/webSQL
/-tests ...
/-tests/files
/-tests/storage ...
/-tests/storage/attached ...
AttachedStorageTests.ts
AttachedStorageTestsNew.ts
DomStorageTests.ts
IndexedDBStorageTests.ts
LocalStorageStorageTests.ts
WebSQLStorageTests.ts
TestCase.html
TestCase.ts
TestPage.css
TestPage.html
TestPage.ts
_sampleTests.ts
teapo-tests.html
teapo-tests.ts
/-typings
Dom.ts
TypeScriptService.ts
functions.ts
ko.ts
nteapo.html
persistence.api.ts
persistence.ts
shell.ts
teapo.html
teapo.ts
try.html
try.js
x
            if (!access) {
 
145
      this._update_loadAgain_sameValue_core(
146
        'update_loadAgain_sameValue_zeroCharOnly.txt', 'property83784', String.fromCharCode(0) + 'abcd',
147
        callback);
148
    }
149
​
150
    update_loadAgain_sameValue_zeroCharSuffix(callback: (error: Error) => void) {
151
      this._update_loadAgain_sameValue_core(
152
        'update_loadAgain_sameValue_zeroCharOnly.txt', 'property83784', 'abcde' + String.fromCharCode(0),
153
        callback);
154
    }
155
​
156
    update_loadAgain_sameValue_zeroCharMiddle(callback: (error: Error) => void) {
157
      this._update_loadAgain_sameValue_core(
158
        'update_loadAgain_sameValue_zeroCharOnly.txt', 'property83784', 'abcde' + String.fromCharCode(0) + 'zxcvbnm',
159
        callback);
160
    }
161
​
162
    update_loadAgain_sameValue_charCodesUnder32(callback: (error: Error) => void) {
163
​
164
      var chars = '';
165
      for (var i = 0; i < 32; i++) chars + String.fromCharCode(i);
166
      this._update_loadAgain_sameValue_core(
167
        'update_loadAgain_sameValue_charCodesUnder32.txt', 'property83784', chars,
168
        callback);
169
    }
170
​
171
​
172
    private _update_loadAgain_sameValue_core(fileName: string, property: string, value: string, callback: (error: Error) => void) {
173
      var ukey = this._generateKey();
174
      this._detect.detect(
175
        ukey,
176
        (error, meta, access) => {
177
          try {
178
            if (!access) {
179
              callback(new Error('BootAccess.open() returned null ' + access));
180
              return;
181
            }
182
          }
183
          catch (error) {
184
            callback(error);
185
            return;
186
          }
187
​
188
          var byFullPath: any = {};
189
          byFullPath[fileName] = {};
190
          byFullPath[fileName][property] = value;
191
​
192
          access.update(byFullPath, 10, (error) => {
193
            this._detect.detect(
194
              ukey,
195
              (error, meta, access) => {
196
                access.read(fileName, (propBag) => {
197
                  if (!propBag[property]) {
198
                    callback(new Error('File is not reported on subsequent load.'));
199
                  }
200
                  else {
201
                    var propertyValue = propBag[property];
202
                    callback(propertyValue === value ? null : new Error('Wrong value ' + JSON.stringify(propertyValue) + ' instead of ' + JSON.stringify(value)));
203
                  }
204
                });
205
              });
206
          });
207
​
208
        });
209
    }
210
​
211
    private _generateKey(): string {
212
      return Math.random() + '-' + Math.random();
213
    }
214
​
215
  }
216
​
217
}
195:0